/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.risk.control.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.hopes.bizz.common.core.util.StringUtils;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 风险分析对象
 *
 * @author daijie
 * @date 2023-07-17 17:01:16
 */
@Data
@TableName("risk_object")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "风险分析对象")
public class RiskObjectEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;

	/**
	* id
	*/
	@TableId(type = IdType.ASSIGN_ID)
    @Schema(description="id")
    private Long id;

	/**
	* 风险对象类型
	*/
    @Schema(description="风险对象类型")
    private Integer hazardType;

	/**
	* 风险对象名称
	*/
    @Schema(description="风险对象名称")
    private String hazardName;

	/**
	* 风险对象编码
	*/
    @Schema(description="风险对象编码")
    private String hazardCode;

	/**
	* 是否重大危险源
	*/
    @Schema(description="是否重大危险源")
    private Boolean hazardSourceFlag;

	/**
	* 固有风险等级
	*/
    @Schema(description="固有风险等级")
    private Integer riskLevel;

	/**
	* 固有风险值
	*/
    @Schema(description="固有风险值")
    private Integer riskValue;

	/**
	* 固有风险描述
	*/
    @Schema(description="固有风险描述")
    private String riskDesc;

	/**
	* 控制后风险值
	*/
    @Schema(description="控制后风险值")
    private Integer afterRiskValue;

	/**
	* 控制后风险等级
	*/
    @Schema(description="控制后风险等级")
    private Integer afterRiskLevel;

	/**
	* 控制后风险描述
	*/
    @Schema(description="控制后风险描述")
    private String afterRiskDesc;

	/**
	* 责任部门
	*/
    @Schema(description="责任部门")
    private String deptId;

	/**
	* 责任岗位
	*/
    @Schema(description="责任岗位")
    private String postId;

	/**
	* 负责人
	*/
    @Schema(description="负责人")
    private String principal;

	/**
	* 管控层级
	*/
    @Schema(description="管控层级")
    private String controlLevel;

	/**
	* 重大危险源标识
	*/
    @Schema(description="重大危险源标识")
    private Long hazardSourceId;

	/**
	* 重大危险源等级
	*/
    @Schema(description="重大危险源等级")
	@TableField(updateStrategy = FieldStrategy.IGNORED)
    private Integer hazardSourceLevel;

	/**
	* 主要负责人
	*/
    @Schema(description="主要负责人")
    private String mainUserId;

	/**
	* 技术负责人
	*/
    @Schema(description="技术负责人")
    private String techUserId;

	/**
	* 操作负责人
	*/
    @Schema(description="操作负责人")
    private String operateUserId;

	/**
	* 经度
	*/
    @Schema(description="经度")
    private String longitude;

	/**
	* 纬度
	*/
    @Schema(description="纬度")
    private String latitude;

	/**
	* 高度
	*/
    @Schema(description="高度")
    private String altitude;

	/**
	* 范围
	*/
    @Schema(description="范围")
    private String areaScope;

	/**
	* 位置描述
	*/
    @Schema(description="位置描述")
    private String areaDesc;

	/**
	* 二维码
	*/
    @Schema(description="二维码")
    private String qrCode;

	/**
	* NFC编码
	*/
    @Schema(description="NFC编码")
    private String nfcCode;

	/**
	* 备注
	*/
    @Schema(description="备注")
    private String remarks;

	/**
	* 照片
	*/
    @Schema(description="照片")
    private String img;

	/**
	* 数据是否上报
	*/
    @Schema(description="数据是否上报")
    private Boolean reportDataFlag;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

	public String getAreaScopeStr() {
		if (StringUtils.isBlank(this.getAreaScope())) {
			return "未标定";
		} else {
			return "已标定";
		}
	}
}